<template>
    <div>
        <el-select v-bind="$attrs" value-key="dataId">
            <el-option v-for="item in options" :key="item.dataId" :label="item.name" :value="item" />
        </el-select>
    </div>
</template>
<script setup lang="ts">
import { getTable } from '@/api/topo/index'
import { getRequest } from '../../utils/index'
const props = defineProps({
    projectId: {
        type: String,
        default: ''
    }
})
const options = ref([])
watch(() => props.projectId, () => {
    props.projectId && getRequest(getTable, { projectId: props.projectId }).then(res => {
        options.value = res.result.data
    })
}, {
    immediate: true,
    deep: true
})


</script>
<style lang="scss" scoped></style>